package com.dlz.systemshop.mapper;


import com.dlz.systemshop.pojo.Goods;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface GoodsMapper{
    Integer insert(Goods goods);

    Integer update(Goods goods);

    @Select("select id, category_id, name, price, picture, " +
            "stock, spec, description from vueshop_goods where id = #{id}")
    Goods queryGoods(Integer id);

    @Select("select * from vueshop_goods")
    public List<Goods> getGoodsListAll();

    @Select("select * from vueshop_goods limit #{offset},#{pageSize}")
    public List<Goods> findGoodsByPage(@Param("offset") Integer offset,@Param("pageSize") Integer pageSize);

    @Select("select count(*) from vueshop_goods")
    public Integer getCount();

    @Delete("delete from vueshop_goods where id = #{id}")
    public Integer delGoods(Integer id);


}
